<?php
define('IN_QY',true);
require("include/common.inc.php");

// 取消订单接口

$sql1 = "select * from tbl_taorder WHERE addtime='".$_POST['qid']."' limit 1";
$res1=mysql_query($sql1);
$row1=mysql_fetch_array($res1);

if($row1['is_pay']=="2"){
	
echo json_encode(array('error'=>1)); 	
	exit;
}

$sql = "update tbl_taorder set is_pay=2  where addtime='".$_POST['qid']."'";
mysql_query($sql);


$sql2 = "select * from tbl_yuehistory WHERE orderid='".$row1['orderid']."'";
$res2=mysql_query($sql2);
$row2=mysql_fetch_array($res2);
  
$sql3 = "update tbl_user set yuee=yuee+ ".$row2['money']." where id='".$_POST['uid']."'";
mysql_query($sql3);
  








echo json_encode(array('error'=>0)); 

//
